from django.db import models
from django.contrib.auth.models import AbstractUser
# Create your models here.


class User(AbstractUser):

    mobile = models.CharField(max_length=12, verbose_name='手机号码')
    avatar = models.ImageField(upload_to='avatar', null=True, blank=True, verbose_name='用户头像')
    sex = models.CharField(max_length=3, default='1', choices=(('1', '男'), ('2', '女')), verbose_name='性别')
    birthday = models.DateTimeField(null=True, blank=True, verbose_name='生日')
    receipt_address = models.TextField(null=True, blank=True, verbose_name='收件地址', default='未填写')
    signature = models.TextField(null=True, blank=True, verbose_name='签名', default='这个人很懒，什么都没有留下 ~')
    WeChat = models.CharField(max_length=50, null=True, blank=True, verbose_name='微信', default='未填写')
    OICQ = models.CharField(max_length=10, null=True, blank=True, verbose_name='QQ', default='未填写')
    professional = models.CharField(max_length=32, null=True, blank=True, verbose_name='职业', default='未填写')
    hobbies = models.CharField(max_length=32, null=True, blank=True, verbose_name='爱好', default='未填写')
    learning_experience = models.CharField(max_length=32, null=True, blank=True, verbose_name='学历', default='未填写')

    class Meta:
        db_table = 'ly_users'
        verbose_name = '用户'
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.username
